1. Field of the Invention
The present invention relates to an image processing system and an image processing method, and, in particular, to an image processing system and an image processing method using a sub-band encoding method.
2. Descriptions of the Related Art
As an image processing technique in the related art, a technique relating to an image coding device is disclosed in Japanese Laid-Open Patent Application No. 7-87327. In this technique, image data is divided into a plurality of block data, the block expressed by each of the plurality of block data having the same predetermined size. Then, for each of the plurality of block data, a quantizer suitable for the characteristics of each of the plurality of block data, for example, the dynamic range of each of the plurality of block data, is used. Each quantizer has a fixed quantization table.
However, in the above-described technique, a high compression efficiency cannot be achieved as a whole.
In an image forming apparatus such as a copy machine or a printer, image data obtained through a scanner undergoes gamma correction or a filtering process so that the image quality is adjusted. The thus-processed image data is stored in a memory, and then the image data is sent to a printing unit.
Generally, such image data undergoes a data compression so that a capacity of the memory can be reduced, which memory stores the processed image data. Generally, in a data compressing method, image data is transformed into frequency components by using an orthogonal transform such as the discrete cosine transform (DCT), and the quantized image data undergoes an entropy encoding.
The variance of the high-frequency components of the transform factors obtained as a result of image data undergoing frequency transform varies in accordance with a magnitude of change in edge degree of the image. Thus, the image quality is improved when a quantizing method is changed in accordance with a type of an image area to be processed.
Japanese Laid-Open Patent Application No. 7-74959 discloses a technique in which a quantization table is changed based on a transform factor obtained as a result of the orthogonal transform being performed on original image data for each of a plurality of block data so that the image quality matches the contents of the image data and a compression rate is improved.
When an image is printed through a copy machine, a character image area and a line image area can be well recognized by causing the tone slope of a contour of the characters or the lines to be steep.
On the other hand, when an image having a gentle tone slope such as a photograph or the like is printed, a random change in the tone having a small amplitude is sensed as a noise. Thus, it is preferred for such a photographic image to reduce the tone slope of an output image. Particularly, in a halftone photographic image, a better image quality can be obtained by reducing the tone slope even for an area having a steep tone slope.
Accordingly, an edge area corresponding to a character image area or a line image area is separated from a halftone image area and a gentle tone slope area of a photographic image so that the edge area undergoes a differential filtering process whereas the photographic image undergoes a smoothing filtering process. Additionally, when an image data compression is performed, another separation of image areas is performed in accordance with degrees of the tone slope in edge areas.
As mentioned above, in the technique in the related art, two separation processes are performed on the same image data and the filtering process is performed separately from the quantizing process. Thus, there is a problem that a process time is increased and a hardware cost is increased.
Additionally, there is a disadvantage, in the technique disclosed in the above-mentioned patent document, that a compression rate is not maximized since a result of the area separation must be also stored as the compressed data.
An object of the present invention is to provide an image processing system and an image processing method which enable quantization through which an image quality of input image data is substantially maintained as a result of using a quantization table, for each of a plurality of block data, which table is suitable for the characteristics of the one of the plurality of block data without determining image areas (for example, determining which one of an image area of characters or lines, an image area of a photograph, or an intermediate image area the one of the plurality of block data belongs to).
Specifically, this object of the present invention is to provide the following image processing system and image processing method.
In the image processing system and image processing method, quantization is performed using a quantizer on each of the plurality of block data, a block expressed by each of the plurality of block data having the same predetermined size, which is obtained as a result of an image of the input image data being divided. Then, whether or not the thus-used quantizer is suitable for the image of the input image data is determined using image data restored from the thus-quantized data. Then, if the result of the determination is that the thus-used quantizer is not suitable for the image of the input image data, another quantizer is used for again quantizing the input image data. Thus, it is possible to perform optimum quantization for each of the plurality of block data.
Another object of the present invention is to provide the following image processing system and image processing method.
In the image processing system and image processing method, the image of input image data is divided into a plurality of band data, a band expressed by each of the plurality of band data having the same predetermined size. Then, for each of the plurality of band data, a frequency transformation is performed on the image data so that a transform factor is obtained for each of the plurality of block data of the one of the plurality of band data. Then, statistics of frequency components of the transform factors are taken and variances of the frequency components of the transform factors are calculated for each of the plurality of band data. The optimum numbers of bits for expressing the image data are determined for each of the plurality of band data by using the thus-obtained variances for the one of the plurality of band data. Then, based on the thus-determined numbers of bits, quantization is performed on each of the plurality of band data. Thus, it is possible to perform an optimum quantization for each of the plurality of band data.
Another object of the present invention is to provide an image processing system and an image processing method in which a filtering process and a data compressing process are concurrently performed so that a process time is reduced with a reduced cost.
There is provided according to the present invention an image processing system comprising:
dividing means for dividing input image data into a plurality of block data, a block expressed by each of the plurality of block data comprising a pixel matrix of the same predetermined size;
transform means for transforming each of the plurality of block data using a frequency transform method so as to produce a transform factor;
quantizing means, having a plurality of quantization tables, for quantizing the transform factor using one of the plurality of quantization tables;
encoding means for encoding the output of the quantizing means;
reverse transform means for restoring image data from the output of the quantizing means; and
measuring means for measuring an error between the input image data and the image data restored by the reverse transform means,
wherein the quantizing means quantizes the transform factor again using another one of the plurality of quantization tables when the error measured by the measuring means exceeds a predetermined threshold value.
In this arrangement, it is not necessary to determine which one of different image areas each of the plurality of block data belongs to. Without performing the above-mentioned determination, it is possible to use the quantization table suitable for the characteristics of the one of the plurality of block data and to perform quantization through which the quality of the input image is substantially maintained.
There is provided according to another aspect of the present invention an image processing system comprising:
dividing means for dividing input image data into a plurality of band data, a band expressed by each of the plurality of band data having the same predetermined size, and then, dividing each of the plurality of band data into a plurality of block data, a block expressed by each of the plurality of block data having the same predetermined size;
transform means for transforming each of the plurality of block data using a frequency transform method so as to produce a transform factor including different types of frequency components, for each of the plurality of band data;
quantizing means for measuring the variance of each of the types of frequency components of the transform factors for each of the plurality of band data, calculating quantization tables suitable for the measured variances, and quantizing the transform factors using the calculated quantization tables; and
encoding means for encoding the output of the quantizing means.
In this arrangement, it is possible to perform quantization through which the quality of the input image is substantially maintained.
The quantizing means may measure the variances of the frequency components of the transform factors of the previously quantized ones of the plurality of band data as well as of the currently quantized one of the plurality of band data.
Thereby, for a lower one of the plurality of band data, an extent for which each variance is measured is wider. As a result, for a lower one of the plurality of band data, it is possible to use the quantization table more suitable for the characteristics of the input data of the entire image. For the last one of the plurality of band data, the quantization table obtained from calculation using the variances calculated using the data of the entire image is used. Thereby, it is possible to perform quantization through which the quality of the input image can be substantially maintained.
Further, it is possible to change the calculated quantization tables.
Thereby, it is possible to perform quantization in accordance with a user""s requirement or wish in the case where it is required to obtain a high-quality restored image although a time required for outputting the image is long, or in the case where it is required to obtain a restored image quickly although the quality of the image is not high.
There is provided according to another aspect of the present invention an image processing system comprising:
dividing means for dividing image data into a plurality of n-by-m pixel matrix block data, where n and m are natural numbers;
transform portion means for transforming the respective pixels in each of the plurality of n-by-m pixel matrix block data using a frequency transform method so as to produce a transform factor;
quantizing means for quantizing the transform factor;
encoding means for encoding the output of the quantizing means using an entropy encoding method;
edge degree calculating means for calculating a slope of rate of change in tone in the one of the plurality of block data based on the transform factor thereof; and
gain changing means for changing the gain of the quantizing means based on the slope calculated by the edge degree calculating means.
In this arrangement, as a result of the gain changing means changing the gain of the quantizing means in accordance with the slope of rate of change in tone calculated by the edge degree calculating means, it is possible to concurrently perform an area separating process and a filtering process for adjusting the quality of an image during a process of data compression. As a result, it is possible to reduce the process time and reduce the costs of the system.
The gain changing means may increase the gain of the quantizing means when the slope calculated by the edge degree calculating means is steep.
In this arrangement, the gain of the quantizing means is changed in accordance with the tone slope in each block, and thereby, it is possible to perform quantization and encoding suitable for the characteristics of the image.
The quantizing means may determine a plurality of ranges into which the transform factor falls, the ranges being defined by a plurality of threshold values, the quantizing means may output a quantization representative value assigned to each of the ranges, and the gain changing means may change the gain of the quantizing means by changing the threshold values.
In this arrangement, because the quantization representative value is fixed even when the gain of the quantizing means is changed as an image area is changed, it is not necessary to store, as compressed data, data indicating the used quantization table, when the quantized data is encoded. Thereby, the compression efficiency is improved.
Additionally, when a difference between the two slopes of adjacent pixel blocks exceeds a predetermined value, the edge degree calculating portion may change a smaller one of the two slopes to be a further smaller value.
In this arrangement, image information of an image area for which it is difficult to visually recognize the accurate change in tone is reduced. Thereby, it is possible to improve the compression rate without causing image degradation to be recognized.
Further, the transform factor may be represented by a plurality of components each having one or a plurality of factors, and the edge degree calculating portion may select a maximum value of the absolute values of the factors as a representative value of each component so as to calculate the slope as a difference between the maximum representative value and the second maximum representative value.
In this arrangement, it is possible to change the edge degree of an image area, for which no problem occurs when the tone slope is smoothed, into a smaller value. Thereby, it is possible to improve the compression rate without causing image degradation to be recognized.
Other objects and further features of the present invention will become more apparent from the following detailed description when read in conjunction with the accompanying drawings.